package com.insta.android.activities;

import android.app.Activity;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.MediaStore;
import android.util.Log;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.ScaleAnimation;
import android.widget.ImageView;
import android.widget.ListView;

import com.insta.android.core.ScanSdCard;
import com.insta.android.dao.MusicAdapter;
import com.insta.android.model.Music;

public class MainActivity extends Activity {
	
	private ImageView mainButton;
	
	Cursor musiccursor;
	int count;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Animation myAnimation = null;
        myAnimation = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 1.0F, Animation.ABSOLUTE, 1.0F);
	    myAnimation.setDuration(1500);
		
	    mainButton = (ImageView) findViewById(R.id.logo);
		mainButton.setAnimation(myAnimation);

		// Appel du CORE pour scanner la carte sd
		ScanSdCard sc = new ScanSdCard(this);
		sc.scanSdCardAndUpdateBdd();
    }
    

    
    public void onChangeStartIcon(View v)
    {
    		ImageView image = (ImageView) v;
    		image.setImageResource(R.drawable.on);
    		Intent intent = new Intent(this, PlayActivity.class);
	    	startActivity(intent);
    }
}